package pres.lnk.learn.designpattern.b_abstractfactory.mysql;


import pres.lnk.learn.designpattern.b_abstractfactory.Action;
import pres.lnk.learn.designpattern.b_abstractfactory.DatabaseFactory;
import pres.lnk.learn.designpattern.b_abstractfactory.mysql.action.MysqlSelectAction;
import pres.lnk.learn.designpattern.b_abstractfactory.mysql.action.MysqlUpdateAction;

import java.util.Date;

/**
 * Mysql工厂
 *
 * @Author lnk
 * @Date 2018/1/31
 */
public class MysqlFactory implements DatabaseFactory {

    @Override
    public Action getAction(String action) {
        if ("select".equalsIgnoreCase(action)) {
            return new MysqlSelectAction();
        } else if ("update".equalsIgnoreCase(action)) {
            return new MysqlUpdateAction();
        }
        return null;
    }
}
